Coinductive Axiomatization of Recursive Type Equality and Subtyping

نویسندگان

  • Michael Brandt
  • Fritz Henglein
چکیده

We present new sound and complete axiomatizations of type equality and subtype inequality for a first-order type language with regular recursive types. The rules are motivated by coinductive characterizations of type containment and type equality via simulation and bisimulation, respectively. The main novelty of the axiomatization is the fixpoint rule (or coinduction principle), which has the form A,P ` P A ` P (Fix) where P is either a type equality τ = τ ′ or type containment τ ≤ τ ′ and the proof of the premise must be contractive in a formal sense. In particular, a proof of A,P ` P using the assumption axiom is not contractive. The fixpoint rule embodies a finitary coinduction principle and thus allows us to capture a coinductive relation in the fundamentally inductive framework of inference systems. ∗This work was partially supported by Danish Research Council Project DART. The results were obtained and written up at DIKU, University of Copenhagen. The new axiomatizations are more concise than previous axiomatizations, particularly so for type containment since no separate axiomatization of type equality is required, as in Amadio and Cardelli’s axiomatization. They give rise to a natural operational interpretation of proofs as coercions. In particular, the fixpoint rule corresponds to definition by recursion. Finally, the axiomatization is closely related to (known) efficient algorithms for deciding type equality and type containment. These can be modified to not only decide type equality and type containment, but also construct proofs in our axiomatizations efficiently. In connection with the operational interpretation of proofs as coercions this gives efficient (O(n2) time) algorithms for constructing efficient coercions from a type to any of its supertypes or isomorphic types. More generally, we show how adding the fixpoint rule makes it possible to define inductively a a set coinductively defined as the kernel (greatest fixed point) of an inference system.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

On sound and complete axiomatization of coinductive subtyping for object-oriented languages

Coinductive abstract compilation is a novel technique, which has been recently introduced for defining precise type systems for objectoriented languages. In this approach, type inference consists in translating the program to be analyzed into a Horn formula f , and in resolving a certain goal w.r.t. the coinductive (that is, the greatest) Herbrand model of f . Type systems defined in this way a...

متن کامل

Subtyping Recursive Games

Using methods drawn from Game Semantics, we build a sound and computationally adequate model of a simple calculus that includes both subtyping and recursive types. Our model solves recursive type equations up to equality, and is shown to validate a subtyping rule for recursive types proposed by Amadio and Cardelli.

متن کامل

Subtyping by Folding an Inductive Relation into a Coinductive One

In this paper we show that a prototypical subtype relation that can neither be defined as a least fixed point nor as a greatest fixed point can nevertheless be defined in a dependently typed language with inductive and coinductive types. The definition proceeds alike a fold in functional programming, although a rather unusual one: that is not applied to any starting object. There has been a rel...

متن کامل

A Symbolic Labelled Transition System for Coinductive Subtyping of Fµ< Types

F is a typed λ-calculus with subtyping and bounded polymorphism. Typechecking for F is known to be undecidable, because the subtyping relation on types is undecidable. Fμ is an extension of F with recursive types. In this paper, we show how symbolic labelled transition system techniques from concurrency theory can be used to reason about subtyping for Fμ . We provide a symbolic labelled transit...

متن کامل

Subtyping Recursive Types Modulo Associative Commutative Products

We study subtyping of recursive types in the presence of associative and commutative products—that is, subtyping modulo a restricted form of type isomorphisms. We show that this relation, which we claim is useful in practice, is a composition of the usual subtyping relation with the recently proposed notion of equality up to associativity and commutativity of products, and we propose an efficie...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • Fundam. Inform.

دوره 33  شماره 

صفحات  -

تاریخ انتشار 1997